package com.pescamillam.kidsspanish;
import java.util.ArrayList;
import java.util.Hashtable;
import java.util.List;

import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;

public class OkListener implements OnClickListener {
	private final int[] btns = {R.id.button1, R.id.button2, R.id.button3, R.id.button4};
	
	Constants cons;
	static Hashtable<String, Hashtable<String, Hashtable<String, Boolean>>> festivos = new Hashtable<String, Hashtable<String,Hashtable<String,Boolean>>>();
	static TextView answer;
	static TextView score;
	private static TextView question;
	KidsSpanishActivity act;
	String type;
	public OkListener(String type, Constants cons, KidsSpanishActivity act) {
		this.type = type;
		this.cons = cons;
		this.act = act;
	}
	
	public void onClick(View v) {
		if (type.equals("bad")) {
			answer.setText("too bad");
			if (cons.points > 0) {
				cons.points--;
			}
		} else if (type.equals("good")) {
			answer.setText("nice job");
			cons.score += cons.points;
			cons.points = 4;
			act.restartOptions();
		}
		score.setText("Score: "+cons.score);
	}
	
	
	public void setAnswerTextView (TextView answerTextView) {
		answer = answerTextView;
	}
	
	public void setQuestionTextView (TextView questionTextView) {
		question = questionTextView;
	}
	
	public void setScoreTextView (TextView scoreTextView) {
		score = scoreTextView;
	}
}
